package com.uziot.security.resource.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shidt
 * @version V1.0
 * @className NewsController
 * @date 2020-08-22 23:08:35
 * @description
 */
@Slf4j
@RestController
public class NewsController {
    @GetMapping(value = "/r1")
    @PreAuthorize("hasAnyAuthority('p1')")
    public String getAllNews() {
        String news = "查询所有新闻列表！";
        log.info(news);
        return news;
    }

}
